import { notification } from 'antd';

export default function (response) {
  if (response.data.code !== 0) {
    notification.error({
      // message: `${response.data.msg || '未知错误'} -- ${response.data.code}`
      message: response.data.msg || '未知错误'
    })
    throw response;
  }

  return response;
}
